<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,height=device-height, user-scalable=no,initial-scale=1, minimum-scale=1, maximum-scale=1,target-densitydpi=device-dpi ">
    <title>创享云购</title>
    <link rel="stylesheet" href="css/zhongchuangyungou.css">
    <link rel="Shortcut Icon"  href="{:APP_URL}favicon.ico" type="image/x-icon">
    <script src="js/jquery.js"></script>
    <style>
    .lijitixian{position: fixed;top: 0;left: 0;background-color: rgba(0,0,0,0.5);width: 100%;height:100%;}
    </style>
</head>

<body>
<div class="tongping">
    <div class="dingbu">
        <div class="fukuan">
            提现申请
        </div>
        <div class="fanhui_1">
            <a href="javascript:history.go(-1);">
                <img src="{:PUBLIC_HOME}Images/fh3.png" alt="">
            </a>
        </div>
    </div>
    <div class="gaodu_1"></div>
    <div class="daqianbao">
        <img src="{:PUBLIC_HOME}Images/qianbao2.png" alt="">
    </div>
    <h2 class="wodelingqian">我的零钱&#40;<span class="wodelingqian1">￥1元＝1金币</span>&#41;</h2>
    <h2 class="wodelingqian2">提现5%手续费</h2>
    <h1 class="wodelingqian3">￥{$money}元</h1>
    <form action="__APP__/Home/User/buy_money" class="wodelingqian4" id="subf" method="post">￥
        <input type="text" name="money" id="mon" value="" placeholder="请输入金额" onkeyup="this.value=this.value.replace(/\D/g,'')"  onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
        <input type="hidden" id="type" name="type" value=""/>
    </form>
    <div class="chongzhi">
        <!--<a href="">-->
            <div class="chongzhi1" onclick="sub()">充值</div>
        <!--</a>-->
        <!--<a href="">-->
            <div class="chongzhi2">提现</div>
        <!--</a>-->
    </div>
    <div class="gaodu"></div>
</div>
<div class="caidan">
    <a href="__APP__/Home/Index/index">
        <div class="caidan_1">
            <div class="caidan_1_1">
                <img src="{:PUBLIC_HOME}Images/sc2.png" alt="">
            </div>
            <h1 class="caidan_2_2">
                商城
            </h1>
        </div>
    </a>
    <a href="__APP__/Home/Article/index">
        <div class="caidan_1">
            <div class="caidan_1_1">
                <img src="{:PUBLIC_HOME}Images/wz2.png" alt="">
            </div>
            <h1 class="caidan_2_2">
                美文分享
            </h1>
        </div>
    </a>
    <a href="__APP__/Home/index/merchants">
        <div class="caidan_1">
            <div class="caidan_1_1">
                <img src="{:PUBLIC_HOME}Images/zs2.png" alt="">
            </div>
            <h1 class="caidan_2_2">
                招商中心
            </h1>
        </div>
    </a>
    <a href="__APP__/Home/User/index">
        <div class="caidan_1">
            <div class="caidan_1_1">
                <img src="{:PUBLIC_HOME}Images/grzx1.png" alt="">
            </div>
            <h1 class="caidan_2_2">
				<span class="caidan_1_2">
				个人中心
				</span>
            </h1>
        </div>
    </a>
</div>

<div class="lijizhifu">
    <div class="lijizhifu1">
            <div class="peisong">
                <h2 class="peisong1">支付金额</h2>
                <h2 class="peisong2"><span class="secai" id="mons">￥{$money}元</span></h2>
                <div class="clearfix"></div>
            </div>
            <div class="lijizhifu2">
            <div class="lijizhifu21">
            <div class="lijizhifu22"><img onclick="qie(1);" id="zfb" src="{:PUBLIC_HOME}Images/weixuan.png" alt=""></div>
            <h2 class="lijizhifu23">支付方式</h2>
            </div>
            <h2 class="lijizhifu24">支付宝安全支付</h2>
            <div class="lijizhifu_tupian"><img src="{:PUBLIC_HOME}Images/zhifubao.png" alt=""></div>
            <div class="clearfix"></div>
            </div>
            <div class="lijizhifu2_1">
                <div class="lijizhifu21">
                    <div class="lijizhifu22"><img onclick="qie(2);" id="wx" src="{:PUBLIC_HOME}Images/yixuan.png" alt=""></div>
                    <h2 class="lijizhifu23">支付方式</h2>
                </div>
                <h2 class="lijizhifu24">微信安全支付</h2>
                <div class="lijizhifu_tupian"><img src="{:PUBLIC_HOME}Images/wxzf.png" alt=""></div>
                <div class="clearfix"></div>
            </div>
            <div class="lijizhifu_bottom" id="gopay">立即支付</div>
    </div>
</div>

<div class="lijitixian">
    <div class="lijitixian1">
            <div class="peisong">
                <h2 class="peisong1">支付金额</h2>
                <h2 class="peisong2"><span class="secai" id="mons">￥{$money}元</span></h2>
                <div class="clearfix"></div>
            </div>
            <div class="lijizhifu2">
                <div class="lijizhifu21">
                    <div class="lijizhifu22"><img onclick="qie(1);" id="zfb" src="{:PUBLIC_HOME}Images/weixuan.png" alt=""></div>
                    <h2 class="lijizhifu23">支付方式</h2>
                </div>
                <h2 class="lijizhifu24">支付宝安全支付</h2>
                <div class="lijizhifu_tupian"><img src="{:PUBLIC_HOME}Images/zhifubao.png" alt=""></div>
                <div class="clearfix"></div>
            </div>
            <div class="lijizhifu2_1">
                <div class="lijizhifu21">
                    <div class="lijizhifu22"><img onclick="qie(2);" id="wx" src="{:PUBLIC_HOME}Images/yixuan.png" alt=""></div>
                    <h2 class="lijizhifu23">支付方式</h2>
                </div>
                <h2 class="lijizhifu24">微信安全支付</h2>
                <div class="lijizhifu_tupian"><img src="{:PUBLIC_HOME}Images/wxzf.png" alt=""></div>
                <div class="clearfix"></div>
            </div>
            <div class="lijizhifu_bottom" id="gopay">立即支付</div>
    </div>
</div>



<div class="chongzhishibai" style="width: 100%;height: 100%;position: fixed;z-index: 5;top: 0;left: 0;background-color: rgba(0,0,0,0.5);<if condition='$type eq 100'>display: block;<else/>display: none;</if>">
    <div class="chongzhishibai1" style="width: 200px;height: 200px;position: absolute;top: 150px;left: 50%;margin-left: -100px;background-color: #fff;border-radius: 10px;">
        <div style="width: 80px;margin: 0 auto;padding-top: 30px;">
            <img src="{:PUBLIC_HOME}Images/success.png" alt="" style="width: 100%">
        </div>
        <div style="text-align: center;font-size: 16px;color: #666;line-height: 30px;padding-top: 10px;">
            充值成功
        </div>

        <!--<div style="text-align: center;font-size: 16px;color: red;line-height: 30px;">-->
            <!--重新充值-->
        <!--</div>-->

    </div>
</div>
<form style="display: none;" method="post" id="subm" action="__APP__/Paycallback/PayCollBack/go_pay">
    <input type="text" id="no" name="trade_no" value=""/>
    <input type="text" id="ord" name="ordsubject" value="充值金币"/>
    <input type="text" id="fee" name="ordtotal_fee" value=""/>
    <input type="text" id="body" name="ordbody" value=""/>
    <input type="text" id="url" name="ordshow_url" value="www.chuangxiangyungou.com"/>
    <input type="text" id="tty" name="method" value="2"/>
</form>
</body>
<script type="text/javascript">
    function sub() {
        if($('#mon').val().length<=0){
            alert('请填写充值金额');
            return false;
        }
        var t = parseFloat($("#mon").val());
        t = t.toFixed(2);
        $("#mons").html("￥"+t+"元");
        $('.lijizhifu').animate({height:'100%'},1000)
        $('.lijizhifu').fadeIn(100);
    }

    document.getElementById("gopay").addEventListener("click",function () {
        if($("#no").val()!=""){
            if($("#tty").val() == 2){ //微信
                alert('努力开发中!');return false;

            }else{ //支付宝
                $("#subm").submit();
            }
            return false;
        }
        if($("#tty").val() == 2){ //微信
            alert('努力开发中!');return false;
        }else{ //支付宝
            $.ajax({
                type: 'POST',
                url: "__APP__/Home/User/buy_money",
                data: {"money":$("#mon").val()},
                success: function (msg) {
                    if(msg['stu'] == 504){
                        alert(msg['info']);return false;
                    }else if(msg['stu'] == 500){
                        $("#no").val(msg.info.order_no);
                        $("#ord").val(msg.info.order_name);
                        $("#fee").val(msg.info.pay_true);
                        $("#body").val(msg.info.leave_word);
                        $("#subm").submit();
                    }
                }
            })
        }
    })
    function qie(type) {
        if(type==1){ //支付宝
            $("#tty").val(1);
            $("#zfb").attr('src','{:PUBLIC_HOME}Images/xz-1.png');
            $("#wx").attr('src','{:PUBLIC_HOME}Images/xz-2.png');
        }else{ //微信
            $("#tty").val(2);
            $("#wx").attr('src','{:PUBLIC_HOME}Images/xz-1.png');
            $("#zfb").attr('src','{:PUBLIC_HOME}Images/xz-2.png');
        }
    }

    // 点击遮罩层外边，立即支付消失
    var lijizhifu = document.querySelector('.lijizhifu');
    var lijizhifu1 = document.querySelector('.lijizhifu1');
    lijizhifu.addEventListener('click',function(event){
        if(event.target.classList[0]==='lijizhifu'){
            $('.lijizhifu').fadeOut(100);
            return;
        }else{
            console.log('选择的不在遮罩层内');
        }
    })
    // 点击遮罩层外边，立即支付消失
    var chongzhishibai = document.querySelector('.chongzhishibai');
    var chongzhishibai1 = document.querySelector('.chongzhishibai1');
    chongzhishibai.addEventListener('click',function(event){
        if(event.target.classList[0]==='chongzhishibai'){
            $('.chongzhishibai').fadeOut(100);
            return;
        }else{
            console.log('选择的不在遮罩层内');
        }
    })
</script>
<script type="text/javascript">
    function sub() {
        if($('#mon').val().length<=0){
            alert('请填写充值金额');
            return false;
        }
        var t = parseFloat($("#mon").val());
        t = t.toFixed(2);
        $("#mons").html("￥"+t+"元");
        $('.lijizhifu').animate({height:'100%'},1000)
        $('.lijizhifu').fadeIn(100);
    }

    document.getElementById("gopay").addEventListener("click",function () {
        if($("#no").val()!=""){
            if($("#tty").val() == 2){ //微信
                alert('努力开发中!');return false;

            }else{ //支付宝
                $("#subm").submit();
            }
            return false;
        }
        if($("#tty").val() == 2){ //微信
            alert('努力开发中!');return false;
        }else{ //支付宝
            $.ajax({
                type: 'POST',
                url: "__APP__/Home/User/buy_money",
                data: {"money":$("#mon").val()},
                success: function (msg) {
                    if(msg['stu'] == 504){
                        alert(msg['info']);return false;
                    }else if(msg['stu'] == 500){
                        $("#no").val(msg.info.order_no);
                        $("#ord").val(msg.info.order_name);
                        $("#fee").val(msg.info.pay_true);
                        $("#body").val(msg.info.leave_word);
                        $("#subm").submit();
                    }
                }
            })
        }
    })
    function qie(type) {
        if(type==1){ //支付宝
            $("#tty").val(1);
            $("#zfb").attr('src','{:PUBLIC_HOME}Images/xz-1.png');
            $("#wx").attr('src','{:PUBLIC_HOME}Images/xz-2.png');
        }else{ //微信
            $("#tty").val(2);
            $("#wx").attr('src','{:PUBLIC_HOME}Images/xz-1.png');
            $("#zfb").attr('src','{:PUBLIC_HOME}Images/xz-2.png');
        }
    }

    // 点击遮罩层外边，立即支付消失
    var lijizhifu = document.querySelector('.lijizhifu');
    var lijizhifu1 = document.querySelector('.lijizhifu1');
    lijizhifu.addEventListener('click',function(event){
        if(event.target.classList[0]==='lijizhifu'){
            $('.lijizhifu').fadeOut(100);
            return;
        }else{
            console.log('选择的不在遮罩层内');
        }
    })
    // 点击遮罩层外边，立即支付消失
    var chongzhishibai = document.querySelector('.chongzhishibai');
    var chongzhishibai1 = document.querySelector('.chongzhishibai1');
    chongzhishibai.addEventListener('click',function(event){
        if(event.target.classList[0]==='chongzhishibai'){
            $('.chongzhishibai').fadeOut(100);
            return;
        }else{
            console.log('选择的不在遮罩层内');
        }
    })
</script>

</html>
